package com.lin.mr.maizilaundry.myadapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by lenovog on 2016/8/24.
 */
public class OrderAdapter extends FragmentPagerAdapter {
    private List<Fragment> fragmentList;
    private String[] title = {"未付款","已付款","已完成"};

    public OrderAdapter(FragmentManager fm, List<Fragment> fragmentList) {
        super(fm);
        this.fragmentList = fragmentList;
    }

    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }

    @Override
    public int getCount() {
        return fragmentList.size();
    }

    //获取标题的方法
    @Override
    public CharSequence getPageTitle(int position) {
        return title[position];
    }
}
